#第一题
def f(a, b, c, d, x):
    return a * x ** 3 + b * x ** 2 + c * x + d
def search(a,b,c,d,left, right,precision):
    while right - left >= precision:
        mid = (left + right) / 2
        if f(a,b,c,d,mid) == 0:
            return mid
        elif f(a,b,c,d,left) * f(a,b,c,d,mid) < 0:
            right = mid
        else:
            left = mid
    return (left + right) / 2
def result(a,b,c,d):
    x1 = search(a,b,c,d,0,3,0.0001)
    x2 = search(a,b,c,d,3,7,0.0001)
    x3 = search(a,b,c,d,7,10,0.0001)
    return[x1,x2,x3]
RESULT = result(a,b,c,d)
#第二题
def soldiers(standard,list):
    list.sort()
    left = 0,right = len(list)
    while left < right:
        mid = ( left + right ) // 2
        if list[mid] >= standard:
            right = mid
        else:
            left = mid + 1
    return list[left:]
#第四题
def count(m,n):
    if m == n:
        return m
    return m + count(m+1,n)